Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

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
rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Internaut! posted:

eh have you done this on the newer generational gcs

iirc you can literally create a billion strings in a tight loop and they all get swept away almost immediately without loving up the heap

actually no I havent

Adbot
ADBOT LOVES YOU

Catalyst-proof
May 11, 2011

better waste some time with you

Gentle Autist posted:

hammer/nail sulk/anything

when all you have is a sulk, everything looks like a anything

skeevy achievements
Feb 25, 2008

by merry exmarx

rotor posted:

actually no I havent

one of my first jobs was to help a client move their platform from AIX/C to Windows/Java and my job was to use MQSeries to connect the two

requests were taking minutes to process, and unfortunately they isolated the problem to somewhere in my code which I claimed which was impossible (because my code didn't really do much except some Java object<->text message translation)

on a hunch I decompiled the IBM's MQ client Java code and found that they were building MQ messages like this really abusive pseudocode

code:
String mqMessage
while incomingMessage.hasMoreCharacters
    mqMessage += nextCharacter
as you know this means they were creating a brand new String of len i for i = 1 to the length of the incoming message, which was typically a few hundred kB, or in other words they were creating ~300,000 Strings at 150kB average size every time they parsed a message in or out

this was the first time I thought the difference between myself and the IBMs of the world might boil down to just marketing and I soon got out of technology consulting

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
(I know jack poo poo about IBM's internal organizatoin, which I'm perfectly fine with) It seems like theres two IBMs: the brilliant people who do crazy poo poo like super-amazing-optimized floating point hardware layout that is still hard to beat, even though the guy was named an IBM fellow for this 20+ years ago, and Watson the jeopardy playing computer

and then the people who manage to concatenate a bunch of strings in time that's quadratic in the length of the output


AFAIK javac from newer JDK releases (maybe > 1.4) will try compile that to a StringBuilder or StringBuffer if you're too dumb to do this yourself

emphasis on "try" to help you with this; i don't know how fragile it is, e.g. "oops, ia dded a variable and now javac can't figure out how to save me from myself"

Relying on javac to help you is pretty dangerous because javac is really stupid

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
srsly magic happens at the Thomas J. Watson Research Center

It's like Google for adults/professionals


The PI for the watson project gave a talk at my university; it was amazing to see the development process for a computer that can play jeopardy

16TB of RAM, IIRC

or was it 128TB. I think something like 2880 CPU cores too

Lysidas fucked around with this message at 16:19 on May 7, 2012

git apologist
Jun 4, 2003

Fren posted:

when all you have is a sulk, everything looks like a anything

rcp nigga

Nomnom Cookie
Aug 30, 2009



Werthog posted:

your posting is always pretty poo poo but this one in particular was offensively bad. please leave and never return.
have you heard of the Overton window? You need me. Not generic "you", you, Werthog, need me to keep posting so you look barely tolerable by comparison.

Nomnom Cookie
Aug 30, 2009



rotor posted:

nice comeback, rotor is old, interesting
it took me a solid five minutes to figure out what you meant because that was actually accidental and I just liked the sound of "poo poo rotor says"

btw are you old old or just boomer old

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Lysidas posted:

(I know jack poo poo about IBM's internal organizatoin, which I'm perfectly fine with) It seems like theres two IBMs: the brilliant people who do crazy poo poo like super-amazing-optimized floating point hardware layout that is still hard to beat, even though the guy was named an IBM fellow for this 20+ years ago, and Watson the jeopardy playing computer

and then the people who manage to concatenate a bunch of strings in time that's quadratic in the length of the output


AFAIK javac from newer JDK releases (maybe > 1.4) will try compile that to a StringBuilder or StringBuffer if you're too dumb to do this yourself

emphasis on "try" to help you with this; i don't know how fragile it is, e.g. "oops, ia dded a variable and now javac can't figure out how to save me from myself"

Relying on javac to help you is pretty dangerous because javac is really stupid

proof?

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
ugh fine

Stringer.java:
code:
public class Stringer
{
	public static void main(String[] args)
	{
		String s = "";
		for (int i = 0; i < 100; i++)
		{
			s += i;
		}
		System.out.println(s);
	}
}
code:
$ javac Stringer.java
$ javap -c Stringer
Compiled from "Stringer.java"
public class Stringer {
  public Stringer();
    Code:
       0: aload_0       
       1: invokespecial #1                  // Method java/lang/Object."<init>":()V
       4: return        

  public static void main(java.lang.String[]);
    Code:
       0: ldc           #2                  // String 
       2: astore_1      
       3: iconst_0      
       4: istore_2      
       5: iload_2       
       6: bipush        100
       8: if_icmpge     36
      11: new           #3                  // class java/lang/StringBuilder
      14: dup           
      15: invokespecial #4                  // Method java/lang/StringBuilder."<init>":()V
      18: aload_1       
      19: invokevirtual #5                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      22: iload_2       
      23: invokevirtual #6                  // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      26: invokevirtual #7                  // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      29: astore_1      
      30: iinc          2, 1
      33: goto          5
      36: getstatic     #8                  // Field java/lang/System.out:Ljava/io/PrintStream;
      39: aload_1       
      40: invokevirtual #9                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
      43: return        
}
$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
i meant proof that javac was stupid

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
no

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
lua wins again

tef
May 30, 2004

-> some l-system crap ->

Lysidas posted:

ugh fine

Stringer.java:
code:
public class Stringer
{
	public static void main(String[] args)
	{
		String s = "";
		for (int i = 0; i < 100; i++)
		{
			s += i;
		}
		System.out.println(s);
	}
}
code:
$ javac Stringer.java
$ javap -c Stringer
Compiled from "Stringer.java"
public class Stringer {
  public Stringer();
    Code:
       0: aload_0       
       1: invokespecial #1                  // Method java/lang/Object."<init>":()V
       4: return        

  public static void main(java.lang.String[]);
    Code:
       0: ldc           #2                  // String 
       2: astore_1      
       3: iconst_0      
       4: istore_2      
       5: iload_2       
       6: bipush        100
       8: if_icmpge     36
      11: new           #3                  // class java/lang/StringBuilder
      14: dup           
      15: invokespecial #4                  // Method java/lang/StringBuilder."<init>":()V
      18: aload_1       
      19: invokevirtual #5                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      22: iload_2       
      23: invokevirtual #6                  // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      26: invokevirtual #7                  // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      29: astore_1      
      30: iinc          2, 1
      33: goto          5
      36: getstatic     #8                  // Field java/lang/System.out:Ljava/io/PrintStream;
      39: aload_1       
      40: invokevirtual #9                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
      43: return        
}
$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

if you're wondering, much of hotspot's optimiser, is dedicated to making up for programmers not understanding java

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

tef posted:

if you're wondering, much of hotspot's optimiser, is dedicated to making up for programmers not understanding java

this is exactly what i meant by "javac is stupid"

i meant stupid = do one simple thing, do it well; and that thing is converting java source code to JVM bytecode.

the real magic happens in the JVM, and expecting javac to do any meaningful optimizations is unwise


(of course converting java source code is nowhere near as simple as it once was, because of the hosed generics design)

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
generics is hilarious

Peanut and the Gang
Aug 24, 2009

by exmarx
i wish there was only one programming language ever. then people wouldnt have to argue.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
PATH is by far the coolest programming language

cowboy beepboop
Feb 24, 2001

when can i just use python instead of javascript

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
you've been able to for like a year and a half :rolleyes:

http://syntensity.com/static/python.html

dragon enthusiast
Jan 1, 2010

barbarianbob posted:

i wish there was only one programming language ever. then people wouldnt have to argue.

verilog

GameCube
Nov 21, 2006

just a butt posted:

verilog

ASICs for everything. i can get behind this

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Lysidas posted:

you've been able to for like a year and a half :rolleyes:

http://syntensity.com/static/python.html

lmao

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
using stringbuffer/builder when it makes sense to use it is like the second thing people are taught in java so i dont know what you're spergin about

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Lysidas posted:

The PI for the watson project gave a talk at my university; it was amazing to see the development process for a computer that can play jeopardy
truly a grownup goal

Toady
Jan 12, 2009

rotor posted:

someone's gotta pay for the internet, it sure as gently caress ain't gonna be you

do web developers really get mad like this over ads

penus de milo
Mar 9, 2002

CHAR CHAR

Toady posted:

do web developers really get mad like this over ads

internet nerds be like "gently caress your banner ads i use adblock :cool:" so the supernerds gotta be like ":rolleyes: adblock is lame you guys are idiots"

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
is it really that hard for some people to not look at ads

Sang-
Nov 2, 2007

Lysidas posted:

(of course converting java source code is nowhere near as simple as it once was, because of the hosed generics design)

on one hand java generics are poo poo. type erasure is really handy all none of the times.

on the other hand it was mostly designed by martin odersky, who basically designed scala himself and is an awesome language that uses a load of neat tricks to get around the limitations of the jvm, which makes the me think that the reason generics are poo poo is the jvm/backwards compatibility.

skeevy achievements
Feb 25, 2008

by merry exmarx
yeah it's not like sun didn't know how to implement generics in the jvm

but by not doing so they kept the jvm stable and also didn't impose any new restrictions on the cool kids like scala and clojure and other poo poo that will keep the jvm rocking for another 10 years

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
tef ive seen you say that in python strings are "infinitely deep" a couuple of times. what does this mean tia

Police Academy III
Nov 4, 2011

Hammerite posted:

tef ive seen you say that in python strings are "infinitely deep" a couuple of times. what does this mean tia

it means that indexing a string gives you another string, so you can do "fart"[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]...

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
lol
>>> repr(""[1:])
"''"

Nomnom Cookie
Aug 30, 2009



Sang- posted:

on one hand java generics are poo poo. type erasure is really handy all none of the times.

on the other hand it was mostly designed by martin odersky, who basically designed scala himself and is an awesome language that uses a load of neat tricks to get around the limitations of the jvm, which makes the me think that the reason generics are poo poo is the jvm/backwards compatibility.

yeah it's not exactly a secret that type erasure is because back compat

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Police Academy III posted:

it means that indexing a string gives you another string, so you can do "fart"[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]...

oh. i assumed it would be something more interesting than that. idk why you'd care much about that

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Hammerite posted:

oh. i assumed it would be something more interesting than that. idk why you'd care much about that

from what i've seen most of the complaints people seem to have about various languages are because they do things differently than other languages they've used

EIDE Van Hagar
Dec 8, 2000

Beep Boop

just a butt posted:

verilog

systemverilog is the one true verilog

jony neuemonic
Nov 13, 2009

ahhh spiders posted:

most of the complaints people seem to have about various languages are because they do things differently than other languages they've used

double sulk
Jul 2, 2010

one of the biggest problems with many programming languages today is lovely documentation

Adbot
ADBOT LOVES YOU

blorpy
Jan 5, 2005

Sulk posted:

one of the biggest problems with many programming languages today is lovely documentation
just because you dont understand programming doesnt mean the documentation is bad

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