New around here? Register your SA Forums Account here!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
CPColin
Sep 9, 2003

Big ol' smile.

Soricidus posted:

runtime is now down to about 15% of what it was before I started fixing performance. possibly I should stop profiling now? but yesterday I thought 200ms was as fast as I could get and now it’s around 140ms and I can’t stop wondering whether 100ms is achievable, help

I look forward to your weekly Twitch stream where you try to beat your personal best.

Adbot
ADBOT LOVES YOU

Soricidus
Oct 20, 2010
freedom-hating statist shill
code:
Butt butt = cache.getIfPresent(buttName);
if (butt == null) {
    buttName += ".butt";
    butt = loadButt(buttName);
    cache.put(buttName, butt);
}
i wonder why loading butts is a huge time sink when we're carefully caching the-- ...oh. oh. :negative:

AggressivelyStupid
Jan 9, 2012

Soricidus posted:

code:
Butt butt = cache.getIfPresent(buttName);
if (butt == null) {
    buttName += ".butt";
    butt = loadButt(buttName);
    cache.put(buttName, butt);
}
i wonder why loading butts is a huge time sink when we're carefully caching the-- ...oh. oh. :negative:

im sorry what the gently caress

Soricidus
Oct 20, 2010
freedom-hating statist shill
turns out caches don't work if you use different keys for reads and stores, which we managed to do without noticing because the read and store use the same variable ... except it's a mutable variable that gets mutated in between

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Soricidus posted:

code:
Butt butt = cache.getIfPresent(buttName);
if (butt == null) {
    buttName += ".butt";
    butt = loadButt(buttName);
    cache.put(buttName, butt);
}
i wonder why loading butts is a huge time sink when we're carefully caching the-- ...oh. oh. :negative:

ah looking at my code again

gonadic io
Feb 16, 2011

>>=
mutation was a mistake

Sapozhnik
Jan 2, 2005

Nap Ghost
mutatis mutandis

cinci zoo sniper
Mar 14, 2013




akadajet
Sep 14, 2003


blast from the past

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
which IDE has a configurable enough auto-formatter to enforce this style?
other than emacs

Soricidus
Oct 20, 2010
freedom-hating statist shill
i think you are failing to understand the level of dedication to the aesthetics of your craft that this style requires. each brace and semicolon must be carefully hand-placed by a code artisan. you cannot simply use a soulless auto-formatter; the results might look the same, but the spirit of the code would be missing, and the whole experience would be cheapened

gonadic io
Feb 16, 2011

>>=
No use of xor swap, 2/10

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

Soricidus posted:

turns out caches don't work if you use different keys for reads and stores, which we managed to do without noticing because the read and store use the same variable ... except it's a mutable variable that gets mutated in between

this is :discourse:

Soricidus
Oct 20, 2010
freedom-hating statist shill
intellij 2019 status: now it's refusing to compile because it claims a variable called "s" might not have been initialized

the reason the variable is not being initialized is that it doesn't loving exist

my code is lovely enough without the ide literally inventing non-existent things to complain about :(

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Soricidus posted:

intellij 2019 status: now it's refusing to compile because it claims a variable called "s" might not have been initialized

the reason the variable is not being initialized is that it doesn't loving exist

my code is lovely enough without the ide literally inventing non-existent things to complain about :(

invalid lambda expression maybe? like (rear end => s.lol)

Soricidus
Oct 20, 2010
freedom-hating statist shill
i figured it out. or at least i figured out where the variable name was coming from.

i had a lambda in a static member assignment, like
code:
private static final Function<Butt, Poop> myPosting = butt -> butt.poop();
and for some reason intellij was complaining, in the class's non-static constructor, that the variable butt might not have been initialized?

the "fix" for now seems to be to rewrite it as
code:
private static final Function<Butt, Poop> myPosting;
static { myPosting = butt -> butt.poop(); }
which i could have sworn was exactly equivalent by definition, but intellij's compiler seems to be ok with whereas the alternative is an error for some reason?

lol java just mash poo poo till it compiles what could possibly go wrong

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Soricidus posted:

i figured it out. or at least i figured out where the variable name was coming from.

i had a lambda in a static member assignment, like
code:
private static final Function<Butt, Poop> myPosting = butt -> butt.poop();
and for some reason intellij was complaining, in the class's non-static constructor, that the variable butt might not have been initialized?

the "fix" for now seems to be to rewrite it as
code:
private static final Function<Butt, Poop> myPosting;
static { myPosting = butt -> butt.poop(); }
which i could have sworn was exactly equivalent by definition, but intellij's compiler seems to be ok with whereas the alternative is an error for some reason?

lol java just mash poo poo till it compiles what could possibly go wrong
Terrible programming: just mash poo poo till it compiles what could possibly go wrong

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Soricidus posted:

i figured it out. or at least i figured out where the variable name was coming from.

i had a lambda in a static member assignment, like
code:
private static final Function<Butt, Poop> myPosting = butt -> butt.poop();
and for some reason intellij was complaining, in the class's non-static constructor, that the variable butt might not have been initialized?

the "fix" for now seems to be to rewrite it as
code:
private static final Function<Butt, Poop> myPosting;
static { myPosting = butt -> butt.poop(); }
which i could have sworn was exactly equivalent by definition, but intellij's compiler seems to be ok with whereas the alternative is an error for some reason?

lol java just mash poo poo till it compiles what could possibly go wrong

this is my experience with Java lambdas as well

CPColin
Sep 9, 2003

Big ol' smile.
What about using Butt::poop?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

CPColin posted:

What about using Butt::poop?

gently caress you too

raminasi
Jan 25, 2005

a last drink with no ice

Soricidus posted:

i figured it out. or at least i figured out where the variable name was coming from.

i had a lambda in a static member assignment, like
code:
private static final Function<Butt, Poop> myPosting = butt -> butt.poop();
and for some reason intellij was complaining, in the class's non-static constructor, that the variable butt might not have been initialized?

the "fix" for now seems to be to rewrite it as
code:
private static final Function<Butt, Poop> myPosting;
static { myPosting = butt -> butt.poop(); }
which i could have sworn was exactly equivalent by definition, but intellij's compiler seems to be ok with whereas the alternative is an error for some reason?

lol java just mash poo poo till it compiles what could possibly go wrong

i know in c#, static initializers (the equivalent of the first thing) are subtly different from static constructors (the equivalent of the second thing) and i could see a theoretical low-effort lambda capture analysis caring about the distinction

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Wheany posted:

runtime went from 1 hour 40 minutes to 20 seconds.

this is the best feeling.

i converted a polygon intersection algorithm (it needed to detect no intersection, intersection, or surrounding) from an algorithm that checked every point against every point (O^n) to a polygonal map quadtree based one that cut runtime of a program on a particularly detailed dataset that cut runtime down from 20 days to like 8 hours. i was treated like a goddamn hero and was given so much slack for the next 2 months i didn't do anything but play browser games.

brand engager
Mar 23, 2011

I'm just over here staring at all our gradle build files

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
say hi to gradlew for me

Arcsech
Aug 5, 2008
technically an "april fools" but pretty good satire

quote:

When AWS launches a service based on an open source project, we are making a long-term commitment to support our customers. We contribute bug fixes, security, scalability, performance, and feature enhancements back to the community.

quote:

Protecting Investment in Software Source (PISS) is a new initiative aimed at reducing the complexity and risk of licensing changes. Once we identify a successful open source project, we will produce a commercial version that our customers can consume as a managed service without worrying about new and arbitrary licensing. If the OSS vendor changes the license terms to prevent us from offering commercial offering, we will create a different copy of the software and offer it to our customers as a managed service. We will never fork an OSS project, because fork is a four letter word that evokes strong emotions from some of the open source warriors out there. Instead we will just create a different version of the software. Instead of a Fork, we will PISS the OSS project, so a commercial version can be created and offered to our customers.

quote:

How do we submit new open source projects for this initiative?

Just tell Alexa to PISS on your favorite open source project. For example: “Alexa, PISS on Tensorflow”

quote:

Where can I buy PISS t-shirts and hats?

The AWS store is the best place for these. In addition to t-shirts and hats, we also have open source branded toilet paper. Currently we are out of stock on Elastic version, but we still have MongoDB version on sale.

Arcsech
Aug 5, 2008
terrible programming: “Alexa, PISS on Tensorflow”

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Arcsech posted:

terrible programming: “Alexa, PISS on Tensorflow”

HoboMan
Nov 4, 2010

besides not being a relational database, is there anything especially bad about mongodb in particular?

Arcsech
Aug 5, 2008

HoboMan posted:

besides not being a relational database, is there anything especially bad about mongodb in particular?

it used to lose data at the drop of a hat. they have since bought another startup for their storage engine and entirely replaced the original one with the one from the startup they acquired. i am told that it is better since they did this

it also used to have really serious problems with its distributed consensus junk, but they have mostly resolved that, although there are still a few issues here and there: http://jepsen.io/analyses/mongodb-3-6-4

the new license is (last i heard) rather vague and a bit questionable although it's probably not an issue if you're not trying to run a mongo-as-a-service cloud thing

it technically supports schemas now, although it does so in a wildly lovely way (it uses json schema, a standard that's overly verbose and awful, and if a document doesn't match the schema, it gives zero feedback on why, just that it doesn't match)

so basically: it's not catastrophically bad, anymore, as long as you can use a recent version. but why would you in a world where postgres exists

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Arcsech posted:

but why would you in a world where postgres exists

Shaggar
Apr 26, 2006

brand engager posted:

I'm just over here staring at all our gradle build files

take a few seconds to switch it over to maven so you don't have to do that anymore

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Shaggar posted:

take a few seconds to switch it over to maven so you don't have to do that anymore

Aramoro
Jun 1, 2012




Shaggar posted:

take a few seconds to switch it over to maven so you don't have to do that anymore

I want to switch our ant builds over to maven, unfortunately there are dozens of ant files in a fairly complex build structure so it's going to take ages. Even just working out the libs is going to take ages.

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.

Arcsech posted:

so basically: it's not catastrophically bad, anymore, as long as you can use a recent version. but why would you in a world where postgres exists

if you are database is append only then postgres is suitable - if you are modifying records in place you risk entering the realm of disk fragmentation fo-eva.

very recent versions of mongo are ok if you need a document db that stores actual documents that you need to update. if you need a place to dump json you never update again, mysql/pgsql are prolly a better choice.

Shaggar
Apr 26, 2006
json belongs in a dumpster and never in a database

Asleep Style
Oct 20, 2010

brand engager posted:

I'm just over here staring at all our gradle build files

More like grundle am I right?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
if you just want a place to store documents have you considered a file system?

Corla Plankun
May 8, 2007

improve the lives of everyone

Aramoro posted:

I want to switch our ant builds over to maven, unfortunately there are dozens of ant files in a fairly complex build structure so it's going to take ages. Even just working out the libs is going to take ages.

switching to maven to pwn the libs

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Feisty-Cadaver posted:

if you are database is append only then postgres is suitable - if you are modifying records in place you risk entering the realm of disk fragmentation fo-eva.

very recent versions of mongo are ok if you need a document db that stores actual documents that you need to update. if you need a place to dump json you never update again, mysql/pgsql are prolly a better choice.

disk fragmentation? what year is it, again?

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

TheFluff posted:

disk fragmentation? what year is it, again?

what's a disk?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply